﻿using UnityEngine;
using System.Collections;
/// <summary>
/// 柱子发生器
/// </summary>
public class zhuziCtrl : MonoBehaviour
{
    public GameObject pre;
    public float rate = 1;
    float cdtime = 0f;
    void Update()
    {
        if(GameCtrl.gameState == GameState.gameing)
        {
            if(cdtime <= 0)
            {
                cdtime = rate;
                Instantiate(pre);
            }
            else
            {
                cdtime -= Time.deltaTime;
            }
        }
        else
        {
            cdtime = 0f;
        }
    }

}
